import request from '@/utils/request'
import apis from './'

export function getPaidCustomer (parameter) {
  return request({
    url: apis.CustomerList,
    method: 'get',
    params: parameter
  })
}

export function getUnpaidCustomer (parameter) {
  return request({
    url: apis.UnpaidCustomerList,
    method: 'get',
    params: parameter
  })
}

export function getCustomerDetail (id) {
  return request({
    url: `${apis.CustomerDetail}?customer_id=${id}`,
    method: 'get'
  })
}

export function getCustomerTransfer (parameter) {
  return request({
    url: apis.CustomerTransferList,
    method: 'get',
    params: parameter
  })
}

export function getCustomerBusiness (parameter) {
  return request({
    url: apis.CustomerBusinessList,
    method: 'get',
    params: parameter
  })
}

export function getCustomerContract (parameter) {
  return request({
    url: apis.CustomerContractList,
    method: 'get',
    params: parameter
  })
}

export function trackList (parameter) {
  return request({
    url: apis.TrackList,
    method: 'get',
    params: parameter
  })
}

export function getCheck (id) {
  return request({
    url: `${apis.CheckCustomer}?customer_id=${id}`,
    method: 'get'
  })
}

export function postCheck (id) {
  return request({
    url: `${apis.CheckCustomer}?customer_id=${id}`,
    method: 'post'
  })
}

export function getCheckList (parameter) {
  return request({
    url: apis.CheckCustomerList,
    method: 'get',
    params: parameter
  })
}

export function getReceiveList (parameter) {
  return request({
    url: apis.ReceiveList,
    method: 'get',
    params: parameter
  })
}

export function getAbandonList (parameter) {
  return request({
    url: apis.AbandonList,
    method: 'get',
    params: parameter
  })
}

export function getProblemList (parameter) {
  return request({
    url: apis.ProblemList,
    method: 'get',
    params: parameter
  })
}

export function delProblem (id) {
  return request({
    url: `${apis.DelProblem}?customer_id=${id}`,
    method: 'get'
  })
}

export function getAllCustomer (parameter) {
  return request({
    url: apis.AllCustomer,
    method: 'get',
    params: parameter
  })
}

export function getTransfer (parameter) {
  return request({
    url: apis.TransferCustomer,
    method: 'get',
    params: parameter
  })
}

export function postTransfer (data) {
  return request({
    url: apis.TransferCustomer,
    method: 'post',
    data: data
  })
}

export function allTransfer (data, parameter) {
  return request({
    url: apis.TransferCustomer,
    method: 'post',
    params: parameter,
    data: data
  })
}

export function getAppoint () {
  return request({
    url: apis.AppointCustomer,
    method: 'get'
  })
}

export function postAppoint (data, type) {
  return request({
    url: `${apis.AppointCustomer}?type=${type}`,
    method: 'post',
    data: data
  })
}

export function postCustomerDetail (id, data) {
  return request({
    url: `${apis.CustomerDetail}?customer_id=${id}`,
    method: 'post',
    data: data
  })
}

export function lockCustomer (data) {
  return request({
    url: apis.LockCustomer,
    method: 'post',
    data: data
  })
}

export function getOtherCustomer (parameter) {
  return request({
    url: apis.OtherCustomer,
    method: 'get',
    params: parameter
  })
}

export function getTotalState (parameter) {
  return request({
    url: apis.OtherState,
    method: 'get',
    params: parameter
  })
}

export function getLoopState (parameter) {
  return request({
    url: apis.OtherLoopState,
    method: 'get',
    params: parameter
  })
}

export function getPreWechat (id, parameter) {
  return request({
    url: `${apis.OtherWechatState}?filter[uid]=${id}`,
    method: 'get',
    params: parameter
  })
}

export function postAbandon (id) {
  return request({
    url: `${apis.AbandonCustomer}?customer_id=${id}`,
    method: 'get'
  })
}

export function importVipLogList (parameter) {
  return request({
    url: apis.ImportVipLogList,
    method: 'get',
    params: parameter
  })
}

export function getImportVip () {
  return request({
    url: apis.ImportVipAction,
    method: 'get'
  })
}

export function postImportVip (data) {
  return request({
    url: apis.ImportVipAction,
    method: 'post',
    data: data
  })
}

export function delAllOther (type) {
  return request({
    url: `${apis.DelOther}?type=${type}`,
    method: 'get'
  })
}

export function getPublicSubject (parameter) {
  return request({
    url: apis.PublicSubject,
    method: 'get',
    params: parameter
  })
}

export function getSubject (parameter) {
  return request({
    url: apis.GetSubject,
    method: 'get',
    params: parameter
  })
}

export function getAddSubject () {
  return request({
    url: apis.AddSubject,
    method: 'get'
  })
}

export function postAddSubject (data) {
  return request({
    url: apis.AddSubject,
    method: 'post',
    data: data
  })
}
